package com.example.service.impl.kafka;

import com.example.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class MessageKafkaServiceImpl implements MessageService {

    @Autowired
    private KafkaTemplate<String,String> kafkaTemplate;
    @Override
    public void sendMessage(String id) {
        System.out.println("kafka生产者："+id);
        kafkaTemplate.send("test",id);
    }

    @Override
    public String doMessage() {
        return null;
    }
}
